Skip to content

testdata: compare NaN results with the same machine's scalar build - #7

Merged
thesyncim merged 4 commits into
masterfrom
nan-goldens-per-arch
Nov 1, 2026
Merged

thesyncim merged 4 commits into
masterfrom
nan-goldens-per-arch

Conversation

@thesyncim

@thesyncim thesyncim commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Stacked on #4.

abs_sqrt.txt, activation_temp.txt and invariant_call.txt compare both builds against testmain/output, which was recorded on amd64. A NaN produced by an operation (sqrt of a negative number, 0 × Inf) has the sign bit set on amd64 (0xffc00000) and clear on arm64 (0x7fc00000). So on arm64 even the scalar run differs from the recording, and the scripts fail before they get to the simd build.

What these scripts check is that the rewrite gives the same bits as the scalar loop on the machine running it. Now the recording is only compared on amd64, and on every target the simd output is compared against the scalar output saved on the same machine. -update only rewrites sections that already exist, so scalar.out never becomes a golden.

Found while running the suite on an M4 for goav1.

ubuntu-latest is now ubuntu-26.04, which has no qemu-user-static
package, so every run fails at the install step and skips the arm64
tsvc run, the golden check, fmt and lint. qemu-user ships the static
emulators there; link qemu-aarch64-static to it when the name is
missing, as the Makefile runs that name.
Go tip writes export data in iexport version 4, which encodes float
constants exactly. x/tools v0.51.0, and the v0.52.0 release, read only
up to version 3, so on tip go/packages fails for every package:

  cannot import "math" (unstable iexport format version 4, just rebuild
  compiler and std library), export data is newer version - update tool

and every script that runs loopvec fails in the tip job. x/tools master
reads version 4 (golang/tools@966056e2637c). Update to it until a release
includes it. The pinned toolchain is unaffected.
@thesyncim
thesyncim force-pushed the nan-goldens-per-arch branch from 0aa5261 to 4f56b21 Compare October 31, 2026 20:50
go1.27.3 is the latest 1.27 release. Its simd package is the same as
go1.27.1's, so the capability table only changes in its header, and
the -methods crash (golang/go#80657) is still there, as
flag_methods_ice.txt checks. go.mod keeps go 1.27.1: that is the first
release whose simd package loopvec's output compiles against
(go1.27.0's ShiftAllRight takes a uint8).
abs_sqrt.txt, activation_temp.txt and invariant_call.txt compare both
builds with testmain/output, which was recorded on amd64. A NaN that an
operation creates (the square root of a negative number, 0 times
infinity) has the sign bit set on amd64 and clear on arm64, so on arm64
the scalar program itself does not match the recording and the scripts
fail before the simd build runs.

The recording is now compared only on amd64. On every target the simd
build is compared with the scalar build of the same machine, which is
the property these scripts check: the rewrite produces the same bits
the scalar loop does there.
@thesyncim
thesyncim force-pushed the nan-goldens-per-arch branch from 4f56b21 to 93bfd01 Compare October 31, 2026 21:50
@thesyncim
thesyncim merged commit a629d7a into master Nov 1, 2026
2 checks passed
mauri870 pushed a commit that referenced this pull request Nov 4, 2026
The runners have moved to ubuntu-26.04, so this is the qemu part of #1
you said you'd take when that happened. `qemu-user-static` has no
installation candidate there, so every PR now fails at that step and the
arm64 runs, the golden check, fmt and lint get skipped. You can see it
on #7, #9 and #19, where Build, Test and the amd64 tsvc run all pass
first. master's last run predates the move, so the next push will hit it
too.

`qemu-user` has the static emulators on 26.04, just without the
`-static` names, so this installs that and links `qemu-aarch64-static`
when it's missing, since the Makefile runs that name. It's been passing
on my fork's ubuntu-26.04 runners, and this PR's own CI runs it too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant